import Vue from "vue";
import VueRouter, { RouteConfig } from "vue-router";
import Login from "../views/Login.vue";
import Dashboard from "../views/Dashboard.vue";
import ErrorPage from "../views/ErrorPage.vue";
import Chatroom from "../views/Chatroom.vue";
Vue.use(VueRouter);

const routes: Array<RouteConfig> = [
  {
    path: "/login",
    name: "Login",
    component: Login
  },
  {
    path: "/dashboard/*",
    name: "Dashboard",
    component: Dashboard
  },
  {
    path: "/error",
    name: "Error",
    component: ErrorPage
  },
  {
    path: "/",
    name: "Chatroom",
    component: Chatroom
  }
];

const router = new VueRouter({
  mode: "history",
  base: process.env.BASE_URL,
  routes
});

export default router;
